<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改系统开放时间设置')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-opentimeset-edit" th:object="${workstudyOpentimeset}">
            <input name="opentimeSetId" th:field="*{opentimeSetId}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">角色：</label>
                <div class="col-sm-8">
                    <select name="roleId" class="form-control m-b" disabled="disabled" required>
                        <option value="">请选择角色</option>
                        <option th:each="role:${roleList}"  th:value="${role.roleId}" th:text="${role.roleName}" th:field="*{roleId}"  required></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">开始时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="startTime" th:value="${#dates.format(workstudyOpentimeset.startTime, 'yyyy-MM-dd HH:mm')}" class="form-control" placeholder="yyyy-MM-dd HH:mm" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">结束时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="endTime" th:value="${#dates.format(workstudyOpentimeset.endTime, 'yyyy-MM-dd HH:mm')}" class="form-control" placeholder="yyyy-MM-dd HH:mm" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "workstudy/opentimeset";
        $("#form-opentimeset-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-opentimeset-edit').serialize());
            }
        }

        $("input[name='startTime']").datetimepicker();

        $("input[name='endTime']").datetimepicker();
    </script>
</body>
</html>